package com.burgeon.backend.SHOP.mappers;

import com.burgeon.backend.SHOP.entity.Order;
import com.burgeon.backend.SHOP.entity.OrderItem;
import com.burgeon.backend.SHOP.entity.presell.Presell;

import java.util.List;

public interface OrderMapper {

    Integer upOrderYCRetail(String id,String retail);

    //订单id查询预售单
    Presell FindPresellByOid(String oid);
    //自提延迟天数
    Integer NumberOfDaysOfSelfPickupDelay(String token);

    Integer findRefundInProgress(String token,String uid);

    Integer DelOrderById(String id,String token);

    Integer UpOrderStateById(String id,String state,String token,String time);

    Integer upOrderCodeById(String id,String code);

    List<OrderItem> FindOrderItemByOid(String id);

    Order FindLatestOrder(String oid ,String uid,String token);

    Integer UpERTData(Order order);

    Order FindOrderERPByCode(String code);

    Order FindOrderMail(String id);

    Integer upOrderStateByID(String id, String state,String date);

    //订单id查询erp单号
    Order FindOrderERPData(String id);

    //id查询订单
    Order FindOrder(String id);

    //订单号查询订单
    Order GetOrderByOid(String code);

    /**
     * 根据订单号修改订单状态 0 未支付 1 已支付 2 已发货 3 已收货 4 已评价
     *
     * @param code
     * @param state
     * @return
     */
    Integer upOrderStateByCode(String code, String state,String date);

    /**
     * 插入订单数据
     *
     * @param order 订单数据
     * @return 受影响的行数
     */
    Integer insertOrder(Order order);

    /**
     * 插入订单商品数据
     *
     * @param orderItem 订单商品数据
     * @return 受影响的行数
     */
    Integer insertOrderItem(OrderItem orderItem);


    List<Order> GetOrderByUid(String uid, String token);
}
